const DB = require('../db')
const ProveToken = require('../../token/proveToken')
const getListInfor = (app) =>{
    return async (ctx, next) => {
        let _data;
       await DB.find({},{ title: '教程' }).then((res) =>{
         _data = res;
         
       })

        let Token = ctx.request.query.token
        
        let isToken = await ProveToken(Token)
        
        let isAcess = isToken.conf 
            isToken = isToken.infor
          ctx.response.body = {
              isAcess:isAcess || false,
              _data
          }
    }
}
module.exports =  getListInfor